package com.erp.freight.mapper;

import com.erp.freight.domain.ErpProductFreight;
import com.erp.freight.domain.vo.ErpProductFreightVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 运费试算模版（各物流公司运费格读取）Mapper接口
 *
 * @author erp
 * @date 2023-06-23
 */
public interface ErpProductFreightMapper extends BaseMapperPlus<ErpProductFreightMapper, ErpProductFreight, ErpProductFreightVo> {

    /**
     * 根据物流方案，获取新增版本号
     * @param freightType
     * @return
     */
    String selectMaxReversionByFreightType(@Param("freightType") String freightType);
    String selectYWMaxReversionByFreightType(@Param("freightType") String freightType);

    ErpProductFreight getFreightTemplateByCountryCode(@Param("countryCode") String countryCode,
                                                      @Param("packageType") Integer packageType,
                                                      @Param("weight") String weight,
                                                      @Param("freightType") String freightType);

    /**
     * 获取去重的所有国家编码
     * @return
     */
    List<ErpProductFreight> selectDistinctCountryCode();
}
